//
//  NaviBar.m
//  FunnyProject
//
//  Created by LYL on 3/24/13.
//  Copyright (c) 2013 __MyCompanyName__. All rights reserved.
//

#import "MSNaviBar.h"

@implementation MSNaviBar

static NSString *_backgroundImageName = nil;

+ (void)setBarBackgroundImage:(NSString *)imageName{
    _backgroundImageName = imageName;
}

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (void)drawRect:(CGRect)rect{
    [super drawRect:rect];
    [[UIColor clearColor] set];
    UIRectFill(rect);
    
    UIImage *image = [UIImage imageNamed:_backgroundImageName];
    //    [image drawInRect:rect blendMode:kCGBlendModeNormal alpha:1.f];
    [image drawInRect:CGRectMake(0, rect.size.height - image.size.height, rect.size.width, image.size.height)];
}

@end


@implementation MSNaviBar (Draw)

//- (void)drawRect:(CGRect)rect{
//    UIImage *image = [UIImage imageNamed:@"navbar.png"];
//    [image drawInRect:rect blendMode:kCGBlendModeNormal alpha:1.f];
//}

@end